[% setvar title Perl 6 Summary for the week ending 20030703 %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='Perl 6 Summary for the week ending 20030703'></a><h1>Perl 6 Summary for the week ending 20030703</h1>
<p>&quot;Ooh look, it's another Perl 6 summary. Doesn't that man ever take a
holiday?&quot;
&quot;I think he took one last month.&quot;
&quot;Is it in Esperanto this week?&quot;
&quot;I don't think so.&quot;
&quot;Does Leon Brocard get a mention?&quot;
&quot;It certainly looks that way.&quot;
&quot;Does is start with the internals list again?&quot;
&quot;I think it does, in fact, here it comes now.&quot;</p>
<a name='Approaching Python'></a><h2>Approaching Python</h2>
<p>Discussions (and coding) of the Parrot implementation of Python
continued this week. Michal Wallace is working on taking a preexisting
(but incomplete, it's a proof of concept only) python parse tree -&gt;
parrot code generator and rejigging it to generate code for
IMCC. Assuming the initial rejig is doable, Michal surmises that
getting a complete python compiler will be 'just' a matter of fleshing
out the rest of the visitor methods, 'and then dealing with the
C-stuff.'</p>
<p>Actually, the main strand of this discussion dealt with ways of
extending IMCC to help optimize the translation of stack based code
to code that uses registers more efficiently (register unspilling as
Benjamin Goldberg called it), which should help with any bytecode
translator based efforts.</p>
<p><a href='http://groups.google.com/groups?threadm=3F2473A4.EED8FE8D@hotpop.com' target='_blank'>groups.google.com</a></p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0307281006310.18437-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<a name='Semantics of clone for PIO-objects'></a><h2>Semantics of clone for PIO-objects</h2>
<p>J&uuml;rgen B&ouml;mmels' work on the Parrot IO system continues to
find edge cases in Parrot's memory management subsystem.  As initially
written, a clone call adds a reference to a ParrotIO object, but that
object is neither garbage collected nor refcounted, and it gets
destroyed when its first reference is destroyed. The problem can be
solved by allocating a new ParrotIO in the clone call, but
J&uuml;rgen had some questions about how to handle various things
like what to do with buffering or position pointers.</p>
<p>Jos Visser offered a suggestion involving indirection and reference
counting which met with (at least) Melvin Smith's approval.</p>
<p><a href='http://groups.google.com/groups?threadm=m24r167p89.fsf@helium.physik.uni-kl.de' target='_blank'>groups.google.com</a></p>
<a name='Making 'make' less verbose'></a><h2>Making 'make' less verbose</h2>
<p>Leo T&ouml;tsch checked in a patch to make make's output rather less
verbose. After the patch, the make process only echos the name of the
file being compiled, and doesn't spam your terminal with the entire
compiler commandline (the compiler warnings do that). Some people
liked this. Others didn't.</p>
<p><a href='http://groups.google.com/groups?threadm=3F25264A.4070506@nextra.at' target='_blank'>groups.google.com</a></p>
<a name='Don't trace system areas in sweep ops'></a><h2>Don't trace system areas in sweep ops</h2>
<p>One of the things we discussed at the Parrot BOF was how to solve the
'bogus objects' problem when doing timely destruction sweeps (The
'bogus objects' problem is when the stack walk code detects chimerical
objects through holes in the C stack (hmm... if anyone has a good
drawing of this?)). After much discussion we came to the conclusion
that the trick was to only walk the system stack during DOD (Dead
Object Detection) runs that got triggered via resource
starvation.</p>
<p>This works because &quot;There is nothing unanchored and alive beyond the
runloop's stack&quot;. Brent Dax was impressed, but then, he wasn't at the
BOF so he doesn't know how long it took us to get to the answer.</p>
<p><a href='http://groups.google.com/groups?threadm=3F252519.9060406@nextra.at' target='_blank'>groups.google.com</a></p>
<a name='User defined events'></a><h2>User defined events</h2>
<p>Klaas-Jan Stol wondered if there would be some way of generating and
posting user defined events. Uri Guttman thought that there probably
would be.</p>
<p><a href='http://groups.google.com/groups?threadm=BAY1-DAV50Vo2Zz8dmY0000ac49@hotmail.com' target='_blank'>groups.google.com</a></p>
<a name='PHP/Parrot'></a><h2>PHP/Parrot</h2>
<p>The language implementation insanity continues!</p>
<p>Stephen Thorne announced that he's working on implementing a PHP
parser and is seriously considering targetting Parrot. He asked for
pointers to good docs on how to go about doing so. He worried a
little about bootstrapping as well.</p>
<p>Luke Palmer and Simon Glover were forthcoming with lots of useful
answers and pointers.</p>
<p><a href='http://groups.google.com/groups?threadm=200307291609.46294.stephen@mu.com.au' target='_blank'>groups.google.com</a></p>
<a name='Why Parrot uses Continuation Passing Style'></a><h2>Why Parrot uses Continuation Passing Style</h2>
<p>In a delayed response to a question from Klaas-Jan Stol, Dan has
posted a long message on the reasons for choosing Continuation
Passing Style as Parrot's calling convention. It's definitely worth
the read if you're at all interested in the reasoning behind Parrot
(and the reason that my copy of <i>Perl 6 Essentials</i> has a signed
correction from Dan).</p>
<p><a href='http://groups.google.com/groups?threadm=a0521060ebb4c371912c0@' target='_blank'>groups.google.com</a>[63.120.19.221]</p>
<a name='IMCC supports the Parrot Calling Conventions'></a><h2>IMCC supports the Parrot Calling Conventions</h2>
<p>Leo announced that IMCC's brand of assembler, PIR (I can't remember
what it stands for, Parrot Intermediate Representation perhaps). Of
course, there are things it doesn't quite do yet (tail call
detection, only preserving 'necessary' registers...) and it's
somewhat lacking on the test front, but it's a start. Yay Leo!</p>
<p><a href='http://groups.google.com/groups?threadm=3F26B9E6.9020609@nextra.at' target='_blank'>groups.google.com</a></p>
<a name='Another task for the interested: Coverage'></a><h2>Another task for the interested: Coverage</h2>
<p>Dan threw out another 'task for the interested' this week. At present
we don't have a complete set of coverage tests for the parrot
opcodes, nor do we even know why opcodes do have coverage. Volunteers
to fix this state of affairs (start with a coverage report being
generated as part of the <code>make test</code> run) would be very welcome.</p>
<p>It turns out that Leo already has an &quot;unportable, ugly, slightly
tested&quot; script generating a coverage report of sorts which he
posted. Josh Wilmes also has a coverage testing tool generating
reports on the web, but he'd turned it off following some problems
under testing.</p>
<p><a href='http://groups.google.com/groups?threadm=a05210610bb4c910e2831@' target='_blank'>groups.google.com</a>[63.120.19.221]</p>
<p><a href='http://www.hitchhiker.org/parrot_coverage' target='_blank'>www.hitchhiker.org</a> -- Josh's reports</p>
<a name='Pirate (py...rrot)'></a><h2>Pirate (py...rrot)</h2>
<p>Will the terrible jokes never stop?</p>
<p>Michal Wallace reported to the list on his attempts to retool
amk's <b><i>parrot-gen.py</i></b> to generate code for IMCC. It sounds like he's
making good progress, but his choice of codename -- Pirate, from
py...rrot -- had at least one summarizer groaning.</p>
<p>Later Michal asked the list about the best way of generating
subroutines and asked for some pointers about how best to arrange the
generated code. He also let slip that Pirate could handle Lists,
strings, and ints; assignments; control structures; maths; boolean
logic; and comparisons...</p>
<p>Leo came up with a suggestion about code layout for Michal and spoke
for everyone (I think) when he added:</p>
<p>&quot;Wow.&quot;</p>
<p>Luke Palmer offered a few performance tuning tips (the parrot of Python
translation is currently running 3 times slower than python on
euclid, but I'm sure we'll get that fixed soon enough.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0307300400420.25808-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0307310652190.6807-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<a name='JVM-&gt;PIR translator'></a><h2>JVM-&gt;PIR translator</h2>
<p>Just as we were all giving Michal some good Wow, Joseph Ryan
announced that he had a partially complete JVM-&gt;PIR translator
done, though it still had a few issues.</p>
<p><a href='http://groups.google.com/groups?threadm=3F2A11BF.9000906@osu.edu' target='_blank'>groups.google.com</a></p>
<!-- POD_ERROR: unterminated L<...> at line 174 in file list-summaries/2003/p6summary.2003-08-03.pod -->
<p><i><a href='http://search.cpan.org/perldoc?http:#/jryan.perlmonk.org/images/jirate.tar.gz'>&quot;/jryan.perlmonk.org/images/jirate.tar.gz&quot; in http:</a></i></p>
<a name='Dynamic PMC Classes'></a><h2>Dynamic PMC Classes</h2>
<p>Leo announced that he's started working on dynamic PMC classes. The
idea is that PMCs could be loaded on demand, in a similar fashion
(though hopefully with a nicer interface) to Perl 5's DynaLoader
tricks. He already has something working, and asked for comments.</p>
<p>Dan responded by outlining his thoughts on the interfaces and
requirements for dynamic PMC loading, which weren't quite the same as
what Leo had implemented, but they don't call it <b>soft</b>ware for
nothing.</p>
<p>Christian Renz wondered if there were any plans to allow PMCs to be
implemented in Parrot assembly. Dan confirmed that there were.</p>
<p><a href='http://groups.google.com/groups?threadm=3F27A15C.3060301@nextra.at' target='_blank'>groups.google.com</a></p>
<a name='Question about interpreter == NULL'></a><h2>Question about <code>interpreter == NULL</code></h2>
<p>J&uuml;rgen B&ouml;mmels wondered which functions allowed the
caller to pass in a NULL pointer in place of the interpreter. Some
functions allow this, others fall in big segfaulty heaps. He and Leo
thrashed out the details of what is and isn't allowed, hopefully this
will make it into documentation at some point.</p>
<p><a href='http://groups.google.com/groups?threadm=m2ispin3v2.fsf@helium.physik.uni-kl.de' target='_blank'>groups.google.com</a></p>
<a name='Adding yield semantics to IMCC'></a><h2>Adding <code>yield</code> semantics to IMCC</h2>
<p>Kenneth A Graves has been experimenting with the <code>.pcc_*</code> directives
for implementing function calls, and wants to add coroutine support
by implementing <code>.pcc_begin_yield</code> and <code>.pcc_end_yield</code> which would
be analogous to the current <code>.pcc_*_return</code> directives. He supplied
a patch implementing what he was after. Leo liked the patch and
applied it.</p>
<p><a href='http://groups.google.com/groups?threadm=rt-23186-62028.2.9714262157627@rt.perl.org' target='_blank'>groups.google.com</a></p>
<a name='IMCC objects speed, .include, file-scoped vars et cetera'></a><h2>IMCC objects speed, <code>.include</code>, file-scoped vars et cetera</h2>
<p>Now that Parrot nearly has objects, Jerome Quelin has started work on
a new version of Befunge in IMCC. This meant he had a pile of
questions about speed, file scoping of variables, problems with line
numbering within included files, and fragility in the absence of
newline termination.</p>
<p>Melvin Smith opined that the time had come to start putting together
a nice web based set of docs for IMCC, and volunteered to start work
on it himself as soon as he'd caught up with the current state of the
IMCC art.</p>
<p>Leo T&ouml;tsch meanwhile answered most of Jerome's questions.</p>
<p><a href='http://groups.google.com/groups?threadm=200307312302.13304.jquelin@mongueurs.net' target='_blank'>groups.google.com</a></p>
<a name='IMCC's call vs first class functions'></a><h2>IMCC's <code>call</code> vs first class functions</h2>
<p>If you were still not sure of the virtues of Continuation Passing
Style in Parrot, then Michal Wallace's problems with making first
class function objects in Pirate might help convince you of their
virtue. As far as I can see, just switching to a CPS style should
mean that anonymous functions in Pirate become almost automatic. (I
could be wrong of course)</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308011305360.23256-100000@hydrogen.sabren.com' target='_blank'>groups.google.com</a></p>
<a name='David Adler Scares Himself'></a><h2>David Adler Scares Himself</h2>
<p>For reasons best known only to himself Dave Adler has implemented an
hq9+ interpreter in pasm. Quite what an hq9+ interpreter is was left as an
exercise for the interested reader. Having just now done the Google
search for the language, I think it's best if I leave it to you to do
the search yourself, but quite frankly, I wouldn't bother.</p>
<p><a href='http://groups.google.com/groups?threadm=20030802054905.GA22806@panix.com' target='_blank'>groups.google.com</a></p>
<a name='Upcoming backwards incompatible changes to IMCC'></a><h2>Upcoming backwards incompatible changes to IMCC</h2>
<p>Leo T&ouml;tsch announced some changes to IMCC which will mean it is no
longer backwards compatible. What's changing is that from now, all
code outside of compilation units will be ignored, which means that
nested subroutines will no longer be supported. He will also be
adding a new <code>.globalconst</code> directive for declaring file scoped
constants.</p>
<p><a href='http://groups.google.com/groups?threadm=3F2B7BA0.9020500@nextra.at' target='_blank'>groups.google.com</a></p>
<a name='Embedding Parrot'></a><h2>Embedding Parrot</h2>
<p>Jeff Horwitz is interested in embedding parrot in other programs, and
wanted to know if there was any prior art, or even a road map. So far
there's been no response.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.44.0308021218250.18912-100000@booger.sixgeeks.org' target='_blank'>groups.google.com</a></p>
<a name='Meanwhile, in perl6-language'></a><h1>Meanwhile, in perl6-language</h1>
<p>Things are starting to warm up a little in perl6-language
following the publication of Exegesis 6 (take a look, you'll find it
at <a href='http://www.perl.com/pub/a/2003/07/29/exegesis6.html,' target='_blank'>www.perl.com</a> there's
much good stuff in there; Perl 6 is starting to look like a real
language I tell you). The volume's not got up to post-Apocalypse 6
levels yet, but it's early days yet.</p>
<a name='Perl 6's for() signature'></a><h2>Perl 6's <code>for()</code> signature</h2>
<p>John Siracusa referred back to an earlier summary where I had
wondered if either of two <code>for</code> implementations had got the
signature quite right. Luke Palmer (perpetrator of one of the for
implementations) thought that it wasn't quite possible to come up
with an accurate signature for <code>for</code> (or at least, not one that
could tell the compiler enough to detect errors at compile time.)
because you essentially needed a slurpy list followed by a block, but
slurpy lists have to be the last parameter in the signature.</p>
<p>John countered by quoting from Exegesis 6 &quot;An important goal of Perl
6 is to make the language powerful enough to implement all its own
built-ins&quot;, which doesn't exactly contradict what Luke said, as
there's always the possibility of implementing something <code>for</code>-like
using a macro, but that doesn't feel too comfortable.</p>
<p>Rod Adams proposed &quot;non-greedy slurpy arrays&quot; which would be
analogous to non-greedy regex matches and proposed <code>*?@</code> as the
sigil combination for such a parameter. (Perl? Line noise? Never!)</p>
<p>Damian Conway tweaked Simon Cozens' &quot;Soylen^WPerl 6 is Ruby!&quot;
detector when he mentioned that Larry was considering adding a
special case for allowing a single <code>&amp;block</code> parameter after a slurpy
parameter, but that both Larry and Damian weren't entirely happy with the
idea.</p>
<p>Larry offered words of wisdom. As usual.</p>
<p><a href='http://groups.google.com/groups?threadm=F2B0434A-C36C-11D7-961B-0050E4A0A466@mindspring.com' target='_blank'>groups.google.com</a></p>
<p><a href='http://www.perl.com/pub/a/2003/04/p6pdigest/20030427.html?page=2' target='_blank'>www.perl.com</a>
-- the earlier summary</p>
<p><a href='http://groups.google.com/groups?threadm=20030802010217.GA17906@wall.org' target='_blank'>groups.google.com</a> -- Larry dispenses wisdom</p>
<a name='Exegesis 6: Assume nothing'></a><h2>Exegesis 6: Assume nothing</h2>
<p>Referring to Exegesis 6, Trey Harris wondered how one could curry a
subroutine to always use the default value for the 'assumed'
parameter. He wanted to be able to created a curried function in such
a way that, if the original function's default value changed, the
curried function would reflect that.</p>
<p>I don't think this thread has been resolved to anyone's satisfaction
yet, and I can't quite tell where it's headed. My gut feeling is that
this is a sufficiently rare requirement that Damian's solution of not
using <code>.assuming</code> at all and just writing a simple wrapper function
by hand may be the way forward.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.BSF.4.51.0307301958180.78431@bowser.eecs.harvard.edu' target='_blank'>groups.google.com</a></p>
<a name='Mandating name-only parameters'></a><h2>Mandating name-only parameters</h2>
<p>Mark J. Reed wondered if the new parameter declaration syntax meant
it was possible to declare a mandatory name-only parameter. Damian
thinks it will probably be doable, but only by using traits rather
than the single character prefixes.</p>
<p><a href='http://groups.google.com/groups?threadm=20030801154454.GA4016@charm.turner.com' target='_blank'>groups.google.com</a></p>
<a name='Small Junctions'></a><h2>Small Junctions</h2>
<p>Exegesis 6 describes a junction as &quot;a single scalar value that can
act like two or more values at once&quot;. Dave Whipp wondered how
junctions with 0 or 1 members would behave. As Dave said, the case of
a single member junction is relatively easily to understand, but he's
unsure as to the semantics for a 0 member junction.</p>
<p>Luke Palmer gave a good answer, and pointed at Damian's message about
&quot;Perl 6 and Set Theory&quot; for more detail.</p>
<p><a href='http://groups.google.com/groups?threadm=20030801165457.98906.qmail@onion.perl.org' target='_blank'>groups.google.com</a></p>
<p><a href='http://groups.google.com/groups?hl=en' target='_blank'>groups.google.com</a>&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;safe=off&amp;selm=3DF2FE76.6050602@conway.org&amp;rnum=2</p>
<a name='Macros and is parsed'></a><h2>Macros and <code>is parsed</code></h2>
<p>Abhijit A Mahabal asked for some clarification about the workings of
macros, in particular how/when macro arguments were parsed. The
answer from Larry appears to be that macros get a default <code>parsed</code>
trait, which can be overridden by <code>is parsed</code> when the macro is
declared, so macro arguments are parsed by the macro's <code>parsed</code>
trait.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.GSO.4.53.0308020838010.14060@school.cs.indiana.edu' target='_blank'>groups.google.com</a></p>
<a name='Macro arguments themselves'></a><h2>Macro arguments themselves</h2>
<p>Luke Palmer wondered what macros do about being passed variables,
with a supplementary question about recursive macros. Larry answered
that macros dealt with their arguments in the way that Luke hoped
(it'd be a disaster if the didn't, frankly), but that to get a
recursive macro you would probably have to write a helper function.</p>
<p><a href='http://groups.google.com/groups?threadm=ygcwudvc1hy.fsf@babylonia.flatirons.org' target='_blank'>groups.google.com</a></p>
<a name='Another macro question'></a><h2>Another macro question</h2>
<p>Abhijit A. Mahabal wondered what</p>
<pre>    macro foo() { return { my $x = 7 } }
    foo;
    print $x;</pre>
<p>would be equivalent to. According to Larry, the answer is probably:</p>
<pre>    do { my $x = 7 }
    print $x;</pre>
<p>Which would throw an error under use strict. It seems to me that the
way to get expanded code that looks like:</p>
<pre>    my $x = 7;
    print $x;</pre>
<p>would be to declare <code>foo</code> as:</p>
<pre>    macro foo() { return 'my $x = 7' }</pre>
<p><a href='http://groups.google.com/groups?threadm=Pine.GSO.4.53.0308022223550.20685@school.cs.indiana.edu' target='_blank'>groups.google.com</a></p>
<a name='grep EXPR, LIST'></a><h2><code>grep EXPR, LIST</code></h2>
<p>John Williams wondered if the Perl 5ish <code>grep EXPR, LIST</code> would
still work in Perl 6. Larry thinks not. I think it should be possible
to declare an appropriate macro version of grep, but the margins of
this summary are too narrow to contain my solution.</p>
<p><a href='http://groups.google.com/groups?threadm=Pine.LNX.4.33.0308022138390.18148-100000@sharkey.morinda.com' target='_blank'>groups.google.com</a></p>
<a name='Acknowledgements, Announcements and Apologies'></a><h1>Acknowledgements, Announcements and Apologies</h1>
<p>Thanks to Damian for Exegesis 6, Perl 6 may be slow in coming, but I
like it more with each revelation.</p>
<p>Ooh look, another plug for <a href='http://www.bofh.org.uk/.' target='_blank'>www.bofh.org.uk</a></p>
<p>As ever, if you've appreciated this summary, please consider one or
more of the following options:</p>
<ul>
<li><a name='Send money to the Perl Foundation at donate.perl-foundation.org/ and help support the ongoing development of Perl.'></a>Send money to the Perl Foundation at
<a href='http://donate.perl-foundation.org/' target='_blank'>donate.perl-foundation.org</a> and help support the ongoing
development of Perl.</li>
<li><a name='Get involved in the Perl 6 process. The mailing lists are open to all. dev.perl.org/perl6/ and www.parrotcode.org/ are good starting points with links to the appropriate mailing lists.'></a>Get involved in the Perl 6 process. The mailing lists are open  to
all. <a href='http://dev.perl.org/perl6/' target='_blank'>dev.perl.org</a> and <a href='http://www.parrotcode.org/' target='_blank'>www.parrotcode.org</a>
are good starting points with links to the appropriate mailing lists.</li>
<li><a name='Send feedback, flames, money, requests for consultancy, photographic and writing commissions, or suggestions for something else to ask for in this bit to p<a href='mailto:6summarizer@bofh.org.uk'>6summarizer@bofh.org.uk</a>'></a>Send feedback, flames, money, requests for consultancy, photographic
and writing commissions, or suggestions for something else to ask for
in this bit to <i><a href='http://search.cpan.org/perldoc?<a href='mailto:p6summarizer@bofh.org.uk'>p6summarizer@bofh.org.uk</a>'>p<a href='mailto:6summarizer@bofh.org.uk'>6summarizer@bofh.org.uk</a></a></i></li>
</ul>
</div>
